package A_review.review1_14;

import listNodePractice.ListNode;

import javax.print.attribute.standard.NumberUp;
import java.util.List;

public class Fanzhuan {


    public ListNode reverse(ListNode  head){
        if (head==null){
            return  null;
        }

        ListNode  pre= null;
        ListNode cur=head;
        ListNode  next=head;
        while (cur!=null) {
         next=cur.next;
         cur.next=pre;
         pre=cur;
         cur=next;
        }



        return  pre;
    }
}
